import pygame, sys
from pygame.locals import *

FPS = 60
fpsClock = pygame.time.Clock()

pygame.init()
screen = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption("Animation")

WHITE = (255, 255, 255)
cat_img = pygame.image.load("cat.png").convert_alpha()
# cat_img = pygame.transform.smoothscale(cat_img, (10, 10))
print(cat_img.get_rect().width)
print(cat_img.get_rect().height)
catx = 0
caty = 0
direction = 'right'
while True:
	for event in pygame.event.get():
		if event.type == QUIT:
			sys.exit()
	if direction == 'right':
		catx += 5
		if catx == 280:
			direction = 'down'
	elif direction == 'down':
		caty += 5
		if caty == 220:
			direction = 'left'
	elif direction == 'left':
		catx -= 5
		if catx == 0:
			direction = 'up'
	elif direction == 'up':
		caty -= 5
		if caty == 10:
			direction = 'right'

	screen.fill(WHITE)

	screen.blit(cat_img, (catx, caty))

	pygame.display.flip()
	fpsClock.tick(FPS)